package clinicaveterinaria;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JTextField;
import javax.swing.JLabel;
import java.awt.Font;
import java.awt.Color;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class CadAnimal extends JFrame {

	private JPanel contentPane;
	private JTextField txtNome;
	private JTextField txtResponsavel;
	private JTextField txtEspecie;
	private JTextField txtID;
	private JTextField txtSexo;
	private JTextField txtIdade;
	private JTextField txtRaca;
	private JTextField txtPeso;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					CadAnimal frame = new CadAnimal();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public CadAnimal() {
		setBackground(new Color(102, 204, 255));
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 386, 580);
		contentPane = new JPanel();
		contentPane.setBackground(new Color(153, 204, 255));
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		txtNome = new JTextField();
		txtNome.setColumns(10);
		txtNome.setBounds(34, 73, 288, 20);
		contentPane.add(txtNome);
		
		JLabel label = new JLabel("Digite o nome do dono do animal:");
		label.setBounds(44, 48, 324, 14);
		contentPane.add(label);
		
		JLabel label_1 = new JLabel("Digite o nome do veterinario responsavel:");
		label_1.setBounds(44, 107, 334, 14);
		contentPane.add(label_1);
		
		txtResponsavel = new JTextField();
		txtResponsavel.setColumns(10);
		txtResponsavel.setBounds(34, 132, 210, 20);
		contentPane.add(txtResponsavel);
		
		JLabel label_2 = new JLabel("Especie do animal:");
		label_2.setBounds(44, 163, 250, 14);
		contentPane.add(label_2);
		
		txtEspecie = new JTextField();
		txtEspecie.setColumns(10);
		txtEspecie.setBounds(34, 188, 210, 20);
		contentPane.add(txtEspecie);
		
		JLabel label_3 = new JLabel("Id do animal:");
		label_3.setBounds(44, 225, 250, 14);
		contentPane.add(label_3);
		
		txtID = new JTextField();
		txtID.setColumns(10);
		txtID.setBounds(34, 250, 288, 20);
		contentPane.add(txtID);
		
		JLabel label_4 = new JLabel("Sexo do animal:");
		label_4.setBounds(44, 281, 288, 14);
		contentPane.add(label_4);
		
		txtSexo = new JTextField();
		txtSexo.setColumns(10);
		txtSexo.setBounds(34, 306, 210, 20);
		contentPane.add(txtSexo);
		
		JLabel label_5 = new JLabel("Cadastro do Animal");
		label_5.setFont(new Font("Trajan Pro", Font.BOLD, 25));
		label_5.setBounds(34, 11, 298, 26);
		contentPane.add(label_5);
		
		JLabel label_6 = new JLabel("Idade do animal:");
		label_6.setBounds(44, 337, 250, 14);
		contentPane.add(label_6);
		
		txtIdade = new JTextField();
		txtIdade.setColumns(10);
		txtIdade.setBounds(34, 362, 77, 20);
		contentPane.add(txtIdade);
		
		JLabel label_7 = new JLabel("Raca do animal:");
		label_7.setBounds(44, 393, 278, 14);
		contentPane.add(label_7);
		
		txtRaca = new JTextField();
		txtRaca.setColumns(10);
		txtRaca.setBounds(34, 419, 169, 20);
		contentPane.add(txtRaca);
		
		JButton btnCancelar = new JButton("Cancelar");
		btnCancelar.setBounds(79, 520, 89, 23);
		contentPane.add(btnCancelar);
		
		JButton btnEnviar = new JButton("Enviar");
		btnEnviar.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				Clinica.pets.add(
					new Animal(
							txtNome.getText(),
							txtResponsavel.getText(),
							txtEspecie.getText(),
							txtID.getText(),
							txtSexo.getText(),
							txtIdade.getText(),
							txtRaca.getText(),
							txtPeso.getText()
							)
						);
			}
		});
		btnEnviar.setBounds(188, 520, 77, 23);
		contentPane.add(btnEnviar);
		
		JLabel lblPesoDoAnimal = new JLabel("Peso do animal:");
		lblPesoDoAnimal.setBounds(44, 450, 278, 14);
		contentPane.add(lblPesoDoAnimal);
		
		txtPeso = new JTextField();
		txtPeso.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
			}
		});
		txtPeso.setColumns(10);
		txtPeso.setBounds(34, 475, 169, 20);
		contentPane.add(txtPeso);
	}

}
